import { computed } from 'vue';
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';

export const columns = (t: (key: string) => string) => {
  return computed<TableColumnData[]>(() => [
    {
      title: t('searchTable.columns.index'),
      dataIndex: 'id',
      slotName: 'id',
      align: 'center',
      width: 60,
    },
    {
      title: t('searchTable.columns.name'),
      dataIndex: 'name',
      slotName: 'name',
      align: 'center',
      width: 100,
    },
    {
      title: t('searchTable.columns.code'),
      dataIndex: 'code',
      slotName: 'code',
      align: 'center',
      width: 80,
    },
    {
      title: t('searchTable.columns.ak'),
      dataIndex: 'ak',
      slotName: 'ak',
      align: 'center',
      width: 80,
    },
    {
      title: t('searchTable.columns.sk'),
      dataIndex: 'sk',
      slotName: 'sk',
      align: 'center',
      width: 80,
    },
    {
      title: t('searchTable.columns.phone'),
      dataIndex: 'phone',
      align: 'center',
      width: 80,
    },
    {
      title: t('searchTable.columns.email'),
      dataIndex: 'email',
      slotName: 'email',
      align: 'center',
      width: 80,
    },
    {
      title: t('searchTable.columns.state'),
      dataIndex: 'state',
      slotName: 'state',
      align: 'center',
      width: 80,
    },
    {
      title: t('searchTable.columns.address'),
      dataIndex: 'address',
      align: 'center',
      width: 120,
    },
    {
      title: t('searchTable.columns.operations'),
      dataIndex: 'operations',
      slotName: 'operations',
      align: 'center',
      width: 100,
    },
  ]);
};
